import { request } from '@/utils';

// 发布活动
export const build = (data) => {
  return request({
    url: '/activity/base/release',
    method: 'put',
    data,
  });
};

// 关闭活动
export const close = (id) => {
  return request({
    url: `/activity/base/${id}`,
    method: 'put',
  });
};

// 活动数据
export const msg = (id) => {
  return request({
    url: `/activity/base/statistics/${id}`,
    method: 'get',
  });
};

// 修改、再次开启活动
export const update = (data) => {
  return request({
    url: '/activity/base/edit',
    method: 'put',
    data,
  });
};

// 检测敏感词
export const sensitive = (data) => {
  return request({
    url: '/activity/base/checkSensitive',
    method: 'put',
    data,
  });
};

// 邀请排名
export const ranking = (data) => {
  return request({
    url: '/activity/invite/rank-page',
    method: 'post',
    data,
  });
};

// 活动样式预览
export const preview = (data) => {
  return request({
    url: '/activity/packet/info',
    method: 'post',
    data,
  });
};

// 图片上传
export const uploadImg = (data) => {
  return request({
    url: '/common/upload',
    method: 'post',
    data,
  });
};
